package network;

import java.io.IOException;
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;

import encryption.RSA;


import encryption.Hash;

public class CertificateForCA 
{
	String userID;
	String publicKeyMod;
	String publicKeyExp;
	String CAInformation;
	
	private static final int SALT_SIZE = 8;

	
	
	public CertificateForCA() {}
	
	public CertificateForCA(String userID, String publicKeyMod, String publicKeyExp, String CAInformation)
	{
		this.userID = userID;
		this.publicKeyMod = publicKeyMod;
		this.publicKeyExp = publicKeyExp;
		this.CAInformation = CAInformation;
	}
	
	
	public static String HashedCertificate(String certificate) throws NoSuchAlgorithmException, IOException
	{
		return Hash.getHash(certificate,"SHA-1");		
	}
	

	
	public String toString()
	{
		return getUserID() + " " + getPublicKey() + " " + getCAInformation();
	}

	public String getUserID() {
		return userID;
	}

	public void setUserID(String userID) {
		this.userID = userID;
	}

	public String getPublicKey() {
		return publicKeyMod + " " + publicKeyExp;
	}

	public void setPublicKey(String publicKeyMod, String publicKeyExp) {
		this.publicKeyMod = publicKeyMod;
		this.publicKeyExp = publicKeyExp;
	}

	public String getCAInformation() {
		return CAInformation;
	}

	public void setCAInformation(String cAInformation) {
		CAInformation = cAInformation;
	}
	
	public static void main(String[] args) 
	{
		CertificateForCA c = new CertificateForCA("4234", "897829748", "1214152134123","ourCA.org");
	}

	

}
